import 'package:flutter_oldman_health/models/response_data_model.dart';

class MemberModel extends ResponseDataModel<MemberInfo> {
  MemberModel({int code, MemberInfo data, String msg})
      : super(code: code, data: data, msg: msg);

  factory MemberModel.fromJson(Map<String, dynamic> json) {
    // var memberItem = json["data"] as List;
    // memberItem.map((e) => MemberInfo.fromJson(e)).toList()
    return MemberModel(
        code: json["code"],
        data: MemberInfo.fromJson(json["data"]),
        msg: json["msg"]);
  }
}

class MemberInfo {
  String id;
  String phone;
  String name;
  double longitude; // 经度
  double latitude; // 纬度

  MemberInfo({this.id, this.phone, this.name, this.longitude, this.latitude});

  factory MemberInfo.fromJson(Map<String, dynamic> json) {
    return MemberInfo(
        id: json["id"],
        phone: json["phone"],
        name: json["name"],
        longitude: json["longitude"],
        latitude: json["latitude"]);
  }
}
